import java.util.Scanner;
public class Demo1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int n = 0;
        int temp = num;
        while(num != 0 )
        {
            int ge = num % 10;
            num = num / 10;
            n  = n * 10 + ge;
        }
        System.out.println(n);
        System.out.println(n == temp);

    }
}
